<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class NewsModel extends Model{
    //根据new_id 获取new 信息
    public function get($new_id){
        return $this->dbreader()->get($new_id);
    }

    //根据title 获取new 信息
    public function getNewInfoByTitle($title){
        return $this->dbreader()->getNewInfoByTitle($title);
    }


    //获取cate 列表<带分页>
    public function getNewList($curr_page,$per_page,$filter = array()){
        return $this->dbreader()->getNewList($curr_page,$per_page,$filter);
    }

    //添加资讯信息
    public function addNew($category_id, $source_id, $title, $keywords, $description, $status = 1, $summary, $content, $tag, $picture, $user_id, $published = null, $update_time = null){
        return $this->dbreader()->addNew($category_id, $source_id, $title, $keywords, $description, $status, $summary, $content, $tag, $picture, $user_id, $published, $update_time);
    }

    //添加资讯信息
    public function editNew($new_id, $category_id, $source_id, $title, $keywords, $description, $status = 1, $summary, $content, $tag, $picture){
        return $this->dbreader()->editNew($new_id, $category_id, $source_id, $title, $keywords, $description, $status, $summary, $content, $tag, $picture);
    }

    //删除来源信息
    public function delNew($new_id){
        return $this->dbreader()->delNew($new_id);
    }

    //推荐资讯
    public function recommendNew($new_id,$status){
        return $this->dbreader()->recommendNew($new_id,$status);
    }
}